﻿using AutoMapper;
using BankTransfer.Bank.Domain.Domain.Entity;
using BankTransfer.Bank.Infrastructure.Repository.DO;

namespace BankTransfer.Bank.Infrastructure.Repository.Builder
{
    public class AccountBuilder
    {
        private readonly Mapper mapper;

        public AccountBuilder(Mapper mapper)
        {
            this.mapper = mapper;
        }

        internal Account ToAccount(AccountDO accountDO)
        {
            return mapper.Map<AccountDO, Account>(accountDO);
        }

        internal AccountDO FromAccount(Account account)
        {
            return mapper.Map<Account, AccountDO>(account);
        }
    }
}